package com.shopping.mall.auth.VO;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import javax.validation.groups.Default;

/**
 * @Author ZZY
 * @Date 2021/8/9
 */
@Data
public class AdminVo {

    public interface changeAdminInfo extends Default {
    }

    public interface changeAdminInfoBySuper extends Default {
    }

    public interface login extends Default {
    }

    public interface add extends Default {
    }

    @Null(groups = {changeAdminInfo.class})
    @NotBlank(groups = {changeAdminInfoBySuper.class})
    private String id;

    @Null(groups = {changeAdminInfo.class})
    @NotBlank(groups = {login.class, add.class})
    private String username;

    @Null(groups = {changeAdminInfo.class})
    @NotBlank(groups = {login.class, add.class})
    @Pattern(groups = {login.class, add.class}, regexp = "(?!.*\\s)(?!^[\\u4e00-\\u9fa5]+$)(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^.{8,16}$", message = "8-16个字符,不包含空格,必须包含数字,字母或字符至少两种")
    private String password;

    @Null(groups = {changeAdminInfo.class, changeAdminInfoBySuper.class, add.class})
    private Integer level;

    @Null(groups = {changeAdminInfo.class})
    @Max(value = 1,groups = {changeAdminInfoBySuper.class})
    @Min(value = 0,groups = {changeAdminInfoBySuper.class})
    private Integer state;

    @Pattern(regexp = "^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$", message = "错误手机号格式")
    private String phone;

    @Email(message = "错误邮箱格式")
    private String mail;

    private Integer age;

    private Integer gender;

    private String photo;
}
